<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //将二维数组转化为一维数组
        let arr = [
            ['小米','14'],
            ['小搜索','12'],
        ]
        // console.log(arr.flat(Infinity));//提取无数层数

        let newarr = arr.flatMap((item,index)=>{
            // console.log(item,index);
            item = item.filter((item,index)=>{
                return index == 0;
            })
            return item;
        })
        console.log(newarr);
    </script>
</body>
</html>